3.3.62 \(\int \frac {\sec (e+f x) (c+d \sec (e+f x))}{(a+b \sec (e+f x))^2} \, dx\) [262]

Optimal. Leaf size=100 \[ \frac {2 (a c-b d) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2} f}-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))} \]

[Out]

2*(a*c-b*d)*arctanh((a-b)^(1/2)*tan(1/2*f*x+1/2*e)/(a+b)^(1/2))/(a-b)^(3/2)/(a+b)^(3/2)/f-(-a*d+b*c)*tan(f*x+e
)/(a^2-b^2)/f/(a+b*sec(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {4088, 12, 3916, 2738, 214} \begin {gather*} \frac {2 (a c-b d) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{f (a-b)^{3/2} (a+b)^{3/2}}-\frac {(b c-a d) \tan (e+f x)}{f \left (a^2-b^2\right ) (a+b \sec (e+f x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Sec[e + f*x]*(c + d*Sec[e + f*x]))/(a + b*Sec[e + f*x])^2,x]

[Out]

(2*(a*c - b*d)*ArcTanh[(Sqrt[a - b]*Tan[(e + f*x)/2])/Sqrt[a + b]])/((a - b)^(3/2)*(a + b)^(3/2)*f) - ((b*c -
a*d)*Tan[e + f*x])/((a^2 - b^2)*f*(a + b*Sec[e + f*x]))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 2738

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 3916

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a/b)*Si
n[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 4088

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_))
, x_Symbol] :> Simp[(-(A*b - a*B))*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m + 1)/(f*(m + 1)*(a^2 - b^2))), x] + D
ist[1/((m + 1)*(a^2 - b^2)), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(m + 1)*Simp[(a*A - b*B)*(m + 1) - (A*b - a
*B)*(m + 2)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, A, B, e, f}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0]
 && LtQ[m, -1]

Rubi steps

\begin {align*} \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{(a+b \sec (e+f x))^2} \, dx &=-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))}+\frac {\int \frac {(-a c+b d) \sec (e+f x)}{a+b \sec (e+f x)} \, dx}{-a^2+b^2}\\ &=-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))}+\frac {(a c-b d) \int \frac {\sec (e+f x)}{a+b \sec (e+f x)} \, dx}{a^2-b^2}\\ &=-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))}+\frac {(a c-b d) \int \frac {1}{1+\frac {a \cos (e+f x)}{b}} \, dx}{b \left (a^2-b^2\right )}\\ &=-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))}+\frac {(2 (a c-b d)) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{b \left (a^2-b^2\right ) f}\\ &=\frac {2 (a c-b d) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2} f}-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.40, size = 97, normalized size = 0.97 \begin {gather*} \frac {-\frac {2 (a c-b d) \tanh ^{-1}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}+\frac {(-b c+a d) \sin (e+f x)}{(a-b) (a+b) (b+a \cos (e+f x))}}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Sec[e + f*x]*(c + d*Sec[e + f*x]))/(a + b*Sec[e + f*x])^2,x]

[Out]

((-2*(a*c - b*d)*ArcTanh[((-a + b)*Tan[(e + f*x)/2])/Sqrt[a^2 - b^2]])/(a^2 - b^2)^(3/2) + ((-(b*c) + a*d)*Sin
[e + f*x])/((a - b)*(a + b)*(b + a*Cos[e + f*x])))/f

________________________________________________________________________________________

Maple [A]
time = 0.24, size = 132, normalized size = 1.32

method result size
derivativedivides \(\frac {-\frac {2 \left (a d -b c \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-a -b \right )}+\frac {2 \left (a c -d b \right ) \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a +b \right ) \left (a -b \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}}{f}\) \(132\)
default \(\frac {-\frac {2 \left (a d -b c \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-a -b \right )}+\frac {2 \left (a c -d b \right ) \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a +b \right ) \left (a -b \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}}{f}\) \(132\)
risch \(\frac {2 i \left (a d -b c \right ) \left (b \,{\mathrm e}^{i \left (f x +e \right )}+a \right )}{a \left (a^{2}-b^{2}\right ) f \left (a \,{\mathrm e}^{2 i \left (f x +e \right )}+2 b \,{\mathrm e}^{i \left (f x +e \right )}+a \right )}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) a c}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) d b}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) a c}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) d b}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}\) \(396\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

1/f*(-2*(a*d-b*c)/(a^2-b^2)*tan(1/2*f*x+1/2*e)/(a*tan(1/2*f*x+1/2*e)^2-b*tan(1/2*f*x+1/2*e)^2-a-b)+2*(a*c-b*d)
/(a+b)/(a-b)/((a+b)*(a-b))^(1/2)*arctanh((a-b)*tan(1/2*f*x+1/2*e)/((a+b)*(a-b))^(1/2)))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more de

________________________________________________________________________________________

Fricas [A]
time = 2.77, size = 408, normalized size = 4.08 \begin {gather*} \left [\frac {{\left (a b c - b^{2} d + {\left (a^{2} c - a b d\right )} \cos \left (f x + e\right )\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (f x + e\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (f x + e\right ) + a\right )} \sin \left (f x + e\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (f x + e\right )^{2} + 2 \, a b \cos \left (f x + e\right ) + b^{2}}\right ) - 2 \, {\left ({\left (a^{2} b - b^{3}\right )} c - {\left (a^{3} - a b^{2}\right )} d\right )} \sin \left (f x + e\right )}{2 \, {\left ({\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} f \cos \left (f x + e\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} f\right )}}, \frac {{\left (a b c - b^{2} d + {\left (a^{2} c - a b d\right )} \cos \left (f x + e\right )\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (f x + e\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (f x + e\right )}\right ) - {\left ({\left (a^{2} b - b^{3}\right )} c - {\left (a^{3} - a b^{2}\right )} d\right )} \sin \left (f x + e\right )}{{\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} f \cos \left (f x + e\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} f}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e))^2,x, algorithm="fricas")

[Out]

[1/2*((a*b*c - b^2*d + (a^2*c - a*b*d)*cos(f*x + e))*sqrt(a^2 - b^2)*log((2*a*b*cos(f*x + e) - (a^2 - 2*b^2)*c
os(f*x + e)^2 + 2*sqrt(a^2 - b^2)*(b*cos(f*x + e) + a)*sin(f*x + e) + 2*a^2 - b^2)/(a^2*cos(f*x + e)^2 + 2*a*b
*cos(f*x + e) + b^2)) - 2*((a^2*b - b^3)*c - (a^3 - a*b^2)*d)*sin(f*x + e))/((a^5 - 2*a^3*b^2 + a*b^4)*f*cos(f
*x + e) + (a^4*b - 2*a^2*b^3 + b^5)*f), ((a*b*c - b^2*d + (a^2*c - a*b*d)*cos(f*x + e))*sqrt(-a^2 + b^2)*arcta
n(-sqrt(-a^2 + b^2)*(b*cos(f*x + e) + a)/((a^2 - b^2)*sin(f*x + e))) - ((a^2*b - b^3)*c - (a^3 - a*b^2)*d)*sin
(f*x + e))/((a^5 - 2*a^3*b^2 + a*b^4)*f*cos(f*x + e) + (a^4*b - 2*a^2*b^3 + b^5)*f)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (c + d \sec {\left (e + f x \right )}\right ) \sec {\left (e + f x \right )}}{\left (a + b \sec {\left (e + f x \right )}\right )^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e))**2,x)

[Out]

Integral((c + d*sec(e + f*x))*sec(e + f*x)/(a + b*sec(e + f*x))**2, x)

________________________________________________________________________________________

Giac [A]
time = 0.50, size = 173, normalized size = 1.73 \begin {gather*} -\frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} {\left (a c - b d\right )}}{{\left (a^{2} - b^{2}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {b c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - a - b\right )} {\left (a^{2} - b^{2}\right )}}\right )}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e))^2,x, algorithm="giac")

[Out]

-2*((pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(2*a - 2*b) + arctan((a*tan(1/2*f*x + 1/2*e) - b*tan(1/2*f*x + 1/2*e)
)/sqrt(-a^2 + b^2)))*(a*c - b*d)/((a^2 - b^2)*sqrt(-a^2 + b^2)) - (b*c*tan(1/2*f*x + 1/2*e) - a*d*tan(1/2*f*x
+ 1/2*e))/((a*tan(1/2*f*x + 1/2*e)^2 - b*tan(1/2*f*x + 1/2*e)^2 - a - b)*(a^2 - b^2)))/f

________________________________________________________________________________________

Mupad [B]
time = 2.20, size = 106, normalized size = 1.06 \begin {gather*} \frac {2\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {a-b}}{\sqrt {a+b}}\right )\,\left (a\,c-b\,d\right )}{f\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}+\frac {2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a\,d-b\,c\right )}{f\,\left (a+b\right )\,\left (a-b\right )\,\left (\left (b-a\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+a+b\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d/cos(e + f*x))/(cos(e + f*x)*(a + b/cos(e + f*x))^2),x)

[Out]

(2*atanh((tan(e/2 + (f*x)/2)*(a - b)^(1/2))/(a + b)^(1/2))*(a*c - b*d))/(f*(a + b)^(3/2)*(a - b)^(3/2)) + (2*t
an(e/2 + (f*x)/2)*(a*d - b*c))/(f*(a + b)*(a - b)*(a + b - tan(e/2 + (f*x)/2)^2*(a - b)))

________________________________________________________________________________________